home *** CD-ROM | disk | FTP | other *** search
/ The CICA Windows Explosion! / The CICA Windows Explosion! - Disc 2.iso / nt / ntcrn1.zip / NTCROND.DOC < prev    next >
Text File  |  1994-11-25  |  19KB  |  421 lines

  1. --------------------------------------------------------------------------
  2. Windows NT "ntcrond" Version 1.0 A2
  3. --------------------------------------------------------------------------
  4.  
  5. This file contains the following sections:
  6.  
  7. 1. ntcrond Description and Background
  8. 2. Reporting Problems or Suggestions
  9. 3. System Requirements
  10. 4. Installation
  11. 5. Usage
  12. 6. Known Bugs and Limitations
  13. 7. Changes from Previous Versions
  14. 8. Planned Enhancements
  15. 9. Legal Restrictions
  16.  
  17. --------------------------------------------------------------------------
  18.  
  19. 1. Description and Background
  20.  
  21. ntcrond is a Microsoft Windows NT service that emulates the crond utility
  22. developed by AT&T and Hewlett Packard for UNIX.  It allows Windows NT 
  23. users to execute commands at specified dates and times, using "crontab" 
  24. files identical to those used by the UNIX version of crond.  Unlike other 
  25. shareware crond emulators, ntcrond runs completely as a Windows NT 
  26. service, and utilizes the user-level security architecture of Windows NT.  
  27. If a user account does not normally have access to a file, command or 
  28. operation, it won't have it using ntcrond either.  Additionally, 
  29. ntcrond only looks at crontab files during service startup, and when a 
  30. crontab file changes.  This is to reduce the overhead of checking for 
  31. new or changed files every so often.  And, no, it's not in a "while" 
  32. loop that will drain your CPU!  Also, ntcrond achieves outstanding
  33. performance gains by using multiple threads for multiple processes,
  34. resulting in near instantaneous execution of many processes that are
  35. scheduled to execute at the same time.
  36.  
  37. ntcrond was developed primarily because of (1) the lack of such a
  38. service for Windows NT, and (2) the "AT" service provided by Microsoft
  39. was too much of a pain to deal with for commands that needed to run
  40. every 5 minutes, et cetera. . . .
  41.  
  42. ntcrond was developed using Microsoft Visual C/C++ 2.0, several UNIX
  43. manuals, and several gallons of coffee.
  44.  
  45. --------------------------------------------------------------------------
  46.     
  47. 2. Reporting Problems or Suggestions
  48.  
  49. The best way to contact Extreme Software is to send E-Mail to
  50. gparsons@dfw.net (no X.400 please!)
  51.  
  52. ntcrond is not "crippleware".  Rather, it is the same fully functional
  53. version that we at Extreme Software use every day on multiple machines.
  54. However, if you wish to register your copy of ntcrond with Extreme 
  55. Software, you may send $25.00 (U.S. please) to the below address.  
  56. You won't get a fancy bound manual, but you WILL get support, and help 
  57. fund future Extreme Software development projects.  If you like the 
  58. product, PLEASE let us know!  Any feedback is appreciated -- negative 
  59. or otherwise.  We can not, and will not make further enhancements
  60. to ntcrond without your support.
  61.  
  62. If you have questions or problems with ntcrond, we may already be aware 
  63. of them, or already have a fix for them.  Please check the "Known Bugs 
  64. and Limitations" section of this document.
  65.  
  66. Our mailing address is:
  67.  
  68. Extreme Software
  69. 2900 North 22nd Street, #P1
  70. Rogers, AR  72756
  71. USA
  72.  
  73. Commercial licenses are available from Extreme Software.  Please contact
  74. the above address, or send email to gparsons@dfw.net for pricing
  75. information for commercial use.
  76.  
  77. --------------------------------------------------------------------------
  78.  
  79. 3. System Requirements
  80.  
  81. To use ntcrond, your system needs the following:
  82.  
  83. Windows NT 3.5 or later
  84. Acceptable hardware configuration to run Windows NT 3.5
  85. 100 KB of hard disk space
  86.  
  87. Note:  To improve performance, ntcrond loads all crontabs into memory, so
  88.        any additional RAM will improve performance - i.e., prevent the 
  89.        Windows NT subsystems from excessive disk I/O as a result of
  90.        paging.
  91.  
  92. Note:  Many of the security features of ntcrond depend upon the inherent
  93.        security of the Windows NT NTFS file system.  Although ntcrond
  94.        will work, many of the security "hooks" will not.  These are
  95.        listed below where they apply.
  96.  
  97. --------------------------------------------------------------------------
  98.  
  99. 4. Installation
  100.  
  101. Installation of ntcrond is relatively painless.  If you retrieved the
  102. ntcrond.zip, you must first use PKUNZIP (c) or an equivalent to unzip
  103. the package.  The files in this release of ntcrond are:
  104.  
  105. ntcrond.exe   -- the Windows NT service
  106. ntcrond.doc   -- this document
  107. install.cmd   -- a VERY simple installtion script
  108.  
  109. Ideally, you would want to install ntcrond in the %SystemRoot%\system32
  110. directory where most of the other Windows NT services are located.  But,
  111. there is no restriction on the actual location.     Note that the
  112. install.cmd file creates two directories when it is run.  This is the
  113. default.  (If you wish to place the crontab files elsewhere, feel free,
  114. but you'll also have to change some registry entries...)
  115.  
  116. If you have a previous version of ntcrond installed, you should remove
  117. it from your services entry table by typing:
  118.  
  119.               ntcrond -remove
  120.  
  121. This should stop the ntcrond service, and remove it from the services
  122. table.  At this point, you can run the "install.cmd" to reinstall
  123. the newest version.
  124.  
  125. By default, the first time ntcrond is run, it creates a couple
  126. of entries in the registry under HKEY_LOCAL_MACHINE.  To be precise,
  127. these are in:
  128.               SYSTEM\CurrentControlSet\Services\ntcrond
  129.  
  130. The key values are:
  131.               AllowDenyPath: %SystemRoot%\cron\
  132.               CronTabsPath:  %SystemRoot%\cron\crontabs
  133.  
  134. Unless you change these registry entries, ntcrond will look in those
  135. directories for the "cron.allow | cron.deny" and all user crontabs.
  136. Note that the AllowDenyPath key value has no meaning in this Alpha
  137. version of ntcrond.  (See section: Known Bugs and Limitations)
  138.  
  139. If you type ntcrond from a command line without any parameters, you will
  140. see the following:
  141.  
  142.      Extreme Software, ntcrond 1.0 A2 (c) 1994 - All rights reserved
  143.      ---------------------------------------------------------------
  144.      ntcrond -install          to install the service
  145.      ntcrond -stop             to stop the service
  146.      ntcrond -remove           to stop AND remove the service
  147.  
  148. As indicated above, typing "ntcrond -install" will install ntcrond
  149. in the Windows NT available service registry.  At this point, simply
  150. open the Control Panel applet, double click on the Services icon, 
  151. and the ntcrond entry should appear in your service list.  To start the
  152. ntcrond service, simply click on the [Start] button.
  153.  
  154. Note that when ntcrond runs, it is running as if it were logged in
  155. as the "supreme" administrator account.  Therefore, it has no
  156. restrictions on directories, or files.  However, before any line
  157. of any crontab file is run, it is assigned a Security Descriptor
  158. (see your Windows NT programming references) that matches that of
  159. the "owner" of the crontab file.  So, if a user account does not
  160. have access to a particular directory, service or file, the
  161. command will not run.
  162.  
  163. Congratulations, you now have a cron service for Windows NT, and are
  164. ready to begin scheduling tasks!
  165.  
  166. --------------------------------------------------------------------------
  167.  
  168. 5. Usage
  169.  
  170. The key to successfully using ntcrond, is the creation and management
  171. of "crontab" files, or the scripts that ntcrond uses to run your
  172. scheduled tasks.  The crontab file names are the same as the valid 
  173. account names on your Windows NT machine.  For example, if you have
  174. account names of "administrator" and "goober", you would have crontab
  175. files in the "%SystemRoot%\cron\crontabs" directory of "administrator"
  176. and "goober".  Note that, with Windows NT 3.5, you can use long
  177. filenames with the FAT file system.  However, we recommend using NTFS
  178. in order to secure the "%SystemRoot%\cron\crontabs" directory.  Otherwise,
  179. any user could simply create an "administrator" file in the
  180. "%SystemRoot%\cron\crontabs\" directory, and run any job they
  181. choose!  NTFS also provides the ability to mark a file as "owned" by a 
  182. account.  Future releases of ntcrond will use this attribute.
  183.  
  184. To schedule a job for ntcrond, smply create the crontab file.  In previous
  185. versions of ntcrond, any task that was run would NOT have been shown
  186. on the desktop window.  THIS HAS CHANGED WITH THIS RELEASE.
  187.  
  188. In order to allow ntcrond scheduled tasks to interact with the desktop
  189. window, use the 'Allow Service to Interact with the Desktop' checkbox
  190. under the [Startup...] button in the [Control Panel][Services] 
  191. applet.  Be warned however, that if you check this box, ANY task that
  192. is scheduled with ntcrond WILL BE DISPLAYED ON THE DESKTOP OF ANY USER
  193. THAT IS CURRENTLY LOGGED ON (at the console only -- not via network
  194. connection).  So, if you're scheduling a "eyes-only" task to run, be
  195. careful, because EVERYONE will be able to see it. 
  196.  
  197. If you do NOT check this box, ntcrond will run tasks as previous versions
  198. did -- independant of any desktop window, which raises the same issue
  199. of the previous versions.  Namely;
  200.  
  201. If you schedule a task with ntcrond such as:
  202.  
  203.      * * * * * notepad.exe
  204.  
  205. ntcrond will start a copy of notepad every minute for as long as your
  206. machine has available memory and swap space (we've tried it...).
  207. However, YOU WILL NEVER SEE IT ON YOUR SCREEN!  The reason for this
  208. is how services under Windows NT run.  So, as a warning, be VERY
  209. careful WHAT you allow ntcrond to run.  Typically, anything that can
  210. be successfully run as a console process is OK to use with ntcrond.
  211.  
  212. A good rule of thumb to follow is that any task that is "self-terminating"
  213. -- or will run their course, and then exit of their own accord are good
  214. candidates for ntcrond.
  215.  
  216. A crontab file consists of lines of six fields each.  The fields are
  217. separated by spaces or tabs.  The first five fields are integer 
  218. "patterns" that specify the following:
  219.  
  220. minute of day (0 - 59)
  221. hour (0 - 23)
  222. day of month (1 - 31)
  223. month of year (1 - 12)
  224. doy of week (0 - 6 where 0=Sunday)
  225.  
  226. Each of the patterns may be an asterisk "*" meaning ALL allowable values,
  227. or a list of elements separated by commas.  An element may be a single
  228. number, or two numbers separated by a minus sign (inclusive range).  As
  229. with the UNIX flavor of cron, the specification of "days" can be made by
  230. two fields (day of month and day of week).  If both fields are specified
  231. by a list of elements (neither are "*"), then both are adhered to.
  232.  
  233. For example, the following crontab entry:
  234.  
  235.      0 0 4,20 * 6 somecommand.here
  236.  
  237. would run the command "somecommand.here" on the 4th and 20th of each
  238. month, as well as on every Saturday (at Midnight).  To specify days
  239. by a single field, set the other field to "*".  For example, the
  240. following crontab entry:
  241.  
  242.      0 0 * * 6 somecommand.here
  243.  
  244. will run "somecommand.here" ONLY on Saturdays.
  245.  
  246. The sixth field in a crontab entry is a string that is executed by 
  247. Windows NT.  
  248.  
  249. Additionally, you may use the pound sign "#" anywhere in the crontab
  250. file to indicate a comment.  Note, however, that if you have a #
  251. symbol in the middle of the command, or field specifiers, the entry
  252. will not be recognized by ntcrond as a valid line.  For example, the
  253. following lines are invalid:
  254.  
  255. * * # * * * do some command here
  256. * * * * * do some # command here
  257.  
  258. However, the following lines ARE valid for comments:
  259.  
  260. * * * * * do some command here       # this is a comment
  261. # this is a comment and will not be processed by ntcrond
  262.  
  263. By default, as does the UNIX flavor of crond, ntcrond will only allow
  264. crontab files that corrospond to valid Windows NT account IDs.  For 
  265. example, if a Windows NT machine had the following valid accounts:
  266.  
  267. administrator
  268. goofy
  269. mickey
  270. charliebrown
  271.  
  272. Only crontab files by those names would EVER be looked at.  Although
  273. other filenames may be in the %SystemRoot%\cron\crontabs directory,
  274. ntcrond matches the filename with a list of valid user Accounts
  275. before it runs any entries contained in those files.
  276.  
  277.  
  278. --------------------------------------------------------------------------
  279.  
  280. 6. Known Bugs and Limitations
  281.  
  282. The following is a list of known bugs and problems in the current
  283. release of ntcrond.
  284.  
  285. Limitation: Unable to do standard out (stdout) redirection from a 
  286.             crontab file entry
  287. Workaround: If you need to do I/O (file or otherwise) redirection, 
  288.             simply encapsulate all of the commands into a .cmd file,
  289.             and setup the crontab entry to call the .cmd file.  For
  290.             example:
  291.  
  292.             A crontab entry of:
  293.             * * * * * dir d:\*.* > out.dat
  294.  
  295.             will not work.  Instead, create a .cmd file with this line,
  296.             and run the .cmd.
  297.  
  298.             DOIT.CMD
  299.             --------
  300.             dir d:\*.* > out.dat
  301.  
  302.             crontab file
  303.             ------------
  304.             * * * * * doit.cmd
  305.             
  306.             Also, see discussion below about ntcrond interaction with
  307.             the desktop window...
  308.  
  309. Limitation: ntcrond does NOT support the use of line continuation
  310.             (via the "%" character), and all commands must be on a
  311.             single line
  312. Workaround: Again, using the .cmd file method may work, but we're
  313.             currently working on this limitation.
  314.  
  315.  
  316. Limitation: ntcrond does not support user-level environment variables
  317. Workaround: None available at this point.  Microsoft includes header
  318.             files for LAN Manager that will allow this, but to date,
  319.             we've yet to get them to work.
  320.             
  321.  
  322. Limitation: Where's the $%&#@ crontab.exe?????
  323. Workaround: For now, and in the interest of getting this out to the
  324.             huddled masses, all crontab administration must be done
  325.             by a member of the "Administrators" group.  Of course, you
  326.             SHOULD be using the NTFS file system and SHOULD protect
  327.             the %SystemRoot%\cron\crontabs directory from prying eyes.
  328.             A "crontab.exe" will be forthcomming.
  329.  
  330.  
  331. Limitation: There are no "allow.cron" or "deny.cron" files.
  332. Workaround: That is correct.  Good observation.  These files will not
  333.             be used until the "crontab.exe" utility is completed.
  334.  
  335. --------------------------------------------------------------------------
  336.  
  337. 7. Changes from Previous Versions
  338.  
  339. [Version 1.0 A1]
  340. - First Release
  341.  
  342. [Version 1.0 A2]
  343. - ntcrond now interacts with the desktop window if you so desire
  344. - Fixed some VERY obscure memory leaks
  345. - Implemented unicode messages that now appear correctly in Event Viewer
  346. - Added additional semaphores and threading to improve performance
  347. - Fixed a "service stop" error that caused problems on ntcrond stop
  348. - Added "-trace" startup parameter to trace ALL ntcrond operations
  349.   (be VERY careful with this as it can chew up memory pretty fast,
  350.    and slow down your system...)
  351.  
  352. --------------------------------------------------------------------------
  353.  
  354. 8. Planned Enhancements
  355.  
  356. Future enhancements will largely be dictated by the volume of response
  357. this first version of ntcrond generates.  Of course the first items to
  358. be "fixed" are described above in Section 6.  Other enhancements will
  359. follow as time and funding permits.
  360.  
  361. --------------------------------------------------------------------------
  362.  
  363. 9. Legal Restrictions
  364.  
  365.                         ntcrond License
  366.  
  367. ntcrond is Copyright (c) 1994 Extreme Software.  All Rights Reserved
  368.  
  369. The Extreme Software ntcrond Version 1.0 Software, both the binary
  370. executable and the source code (hereafter, Software), is copyrighted and
  371. licensed. Extreme Software provides the Software and licenses its use as 
  372. set forth herein. The Software is, and at all times shall remain, the 
  373. property of Extreme Software, and Licensee shall have no right, title or 
  374. interest therein except as expressly set forth in this agreement. Source 
  375. code, if made available, will be licensed separately.
  376.  
  377. Extreme Software grants to Licensee a license to use, copy and distribute 
  378. the Software for academic, research and personal-use purposes only, 
  379. without a fee, provided that 
  380. (i)   the above copyright notice and this permission notice appear in all 
  381.       copies of the Software and related documentation, and 
  382. (ii)  the Extreme Software name may not be used in any advertising or 
  383.       publicity relating to the Software without the specific, prior 
  384.       written permission of Extreme Software, and 
  385. (iii) that no charge is associated with copies of the Software distributed 
  386.       by Licensee to third parties. Commercial use of this Software is 
  387.       forbidden without the express written permission of Extreme Software
  388.       and payment of a negotiable fee.
  389.  
  390. Any Licensee wishing to make commercial use of the Software should
  391. contact Extreme Software, to negotiate an appropriate license for such 
  392. commercial use. Commercial use includes 
  393. (1) integration of all or part of the Software into a product for sale 
  394.     or license by or on behalf of Licensee to third parties, or 
  395. (2) distribution of the Software to third parties that need it to utilize 
  396.     a commercial product sold or licensed by or on behalf of Licensee.
  397.  
  398. THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
  399. EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, THE IMPLIED WARRANTIES
  400. OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. EXTREME SOFTWARE
  401. DOES NOT WARRANT THAT THE FUNCTIONS CONTAINED IN THE SOFTWARE WILL MEET
  402. LICENSEE'S REQUIREMENTS OR THAT THE OPERATION OF THE SOFTWARE WILL BE
  403. UNINTERRUPTED OR ERROR-FREE. THE ENTIRE RISK AS TO THE QUALITY AND
  404. PERFORMANCE OF THE SOFTWARE IS WITH LICENSEE.
  405.  
  406. IN NO EVENT WILL EXTREME SOFTWARE BE LIABLE TO LICENSEE OR ANY THIRD 
  407. PARTY FOR ANY DAMAGES, INCLUDING ANY LOST PROFITS, LOST SAVINGS OR 
  408. OTHER INCIDENTAL, CONSEQUENTIAL OR SPECIAL DAMAGES ARISING OUT OF THE USE 
  409. OR INABILITY TO USE THE SOFTWARE EVEN IF EXTREME SOFTWARE HAS BEEN 
  410. ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
  411.  
  412. By using or copying the Software, Licensee agrees to abide by the
  413. copyright law and all other applicable laws of the U.S. including, but
  414. not limited to, export control laws, and the terms of this license.
  415. Extreme Software shall have the right to terminate this license 
  416. immediately by written notice upon Licensee's breach of, or 
  417. non-compliance with, any of its terms.  Licensee may be held legally 
  418. responsible for any copyright infringement that is caused or encouraged 
  419. by Licensee's failure to abide by the terms of this license.
  420.  
  421.